package com.mgface.springdata.entity;

import lombok.Data;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 * @author wanyuxiang
 * @version 1.0
 * @project springdataCollection
 * @create 2018-08-17 15:12
 **/
//@Document标识当前类为Mongodb的集合
@Document(collection = "article") //collection：设定该集合的别名，默认为实体类名
@Data
public class Article {
    @Id
    private ObjectId id;
    @Indexed
    private String name;
}
